import React from 'react'
import { Spin, Icon } from 'antd'
import PropTypes from 'prop-types'

const Comp=({ loading, children}) => {
  const antIcon = <Icon type="loading" style={{ fontSize: 30 }} spin />
  return (
    <Spin spinning={!!loading} indicator={antIcon}>
      {children}
    </Spin>
  )
}
Comp.propTypes={
  loading: PropTypes.bool,
}

export default Comp
